package com.beiding.jsonanalyzer.flow.flowevents;

import com.beiding.jsonanalyzer.flow.FlowEvent;

/**
 * 数据产生事件
 *
 * @author 丁常磊
 * @date 2022/5/23 13:25
 */

public class DataNodeEvent<T> implements FlowEvent<T> {

    private T data;

    public DataNodeEvent(T dataNode) {
        this.data = dataNode;
    }

    public T getData() {
        return data;
    }

    private static final DataNodeEvent EVENT_TYPE = new DataNodeEvent(null);

    /**
     * 创建事件类型
     * @param <T>
     * @return
     */
    public static <T> DataNodeEvent<T> eventType() {
        return EVENT_TYPE;
    }


}
